package com.zzt.system.action;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.zzt.common.action.BaseAction;

@Namespace("/")
@Scope("prototype")
@Component("LoginAction")
public class LoginAction extends BaseAction{

	@Autowired
	private SessionFactory sessionFactory;
	@Action(value="login",results={
			@Result(name="success",location="/index.jsp"),
			@Result(name="failure",location="/index.jsp")
	})
	public String login(){
		try {
			Session s=this.sessionFactory.getCurrentSession();
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		return "success";
		
	}

	
}
